# 创建 MarketService 库
add_library(MarketServiceLib STATIC
    Core/Market/BarGenerator.cpp
    Core/Market/MarketDataEngine.cpp
    Core/Market/TrSession.cpp
    Core/Market/HistoryDataEngine.cpp
    Core/Redis/RedisWrapper.cpp
    Service/MarketService.cpp
)

# 设置包含目录
target_include_directories(MarketServiceLib PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_SOURCE_DIR}/Core/Market
    ${CMAKE_CURRENT_SOURCE_DIR}/Core/Redis
    ${CMAKE_CURRENT_SOURCE_DIR}/Core/Network
    ${CMAKE_CURRENT_SOURCE_DIR}/Service
    ${CMAKE_SOURCE_DIR}/Common/include
    ${CTP_INCLUDE_DIR}
)

# 链接依赖库
target_link_libraries(MarketServiceLib PUBLIC
    Qt5::Core
    Qt5::Network
    Common
    redis++::redis++_static
    hiredis::hiredis
    spdlog::spdlog
    nlohmann_json::nlohmann_json
    fmt::fmt
)

# 创建主可执行文件
add_executable(MarketService main.cpp)

# 链接主可执行文件的依赖
target_link_libraries(MarketService PRIVATE
    MarketServiceLib
) 